//守望者的逃离 其实可以贪心更简单
#include <iostream>
using namespace std;
const int MAXT=300000;
int m,s,t;
int maxs[MAXT+1][10];//maxs[i][j]表示在时间为i、魔法值为j时能走到的最大距离

int main(){
    cin>>m>>s>>t;
    int t1=0;
    int s1=0;
    //先让多余的魔法值通过闪现消耗掉，这样魔法值就在10以内
    while(s1<s&&t1<(m/10)){
        t1++;
        s1+=60;
    }
    if (t1>t){
        cout<<"No"<<endl;
        cout<<t*60;
        return 0;
    }
    if (s1>=s){
        cout<<"Yes"<<endl;
        cout<<t1;
        return 0;
    }
    //动规初始化
    for(int i=0;i<=t;i++)
        for(int j=0;j<=9;j++) maxs[i][j]=-1*100000000;
    
    maxs[t1][m%10]=s1;  
    //动规
    for(int i=t1;i<t;i++)
        for(int j=9;j>=0;j--){
        if (maxs[i+1][j]<maxs[i][j]+17)  maxs[i+1][j]=maxs[i][j]+17;
        if (j<6){
            if (maxs[i+1][j+4]<maxs[i][j]) maxs[i+1][j+4]=maxs[i][j];
        }else if (i+2<=t) {
            if (maxs[i+2][j+4-10]<maxs[i][j]+60) maxs[i+2][j+4-10]=maxs[i][j]+60;
        }
    }
    //找出最早逃出时间
    for(int i=t1;i<=t;i++)
        for(int j=0;j<=9;j++){
            if (maxs[i][j]>=s){
                cout<<"Yes"<<endl;
                cout<<i;
                return 0;
            }
        }
    //不能逃出时找出最大距离
    int ans=0;
    for(int j=0;j<=9;j++)
        if (maxs[t][j]>ans) ans=maxs[t][j];
    cout<<"No"<<endl;
    cout<<ans;
    
}   
